export type Page = {
  current: number;
  pageSize: number;
}
export type PageData = {
  current: number;
  pages: number;
  records: any[];
  size: number;
  total: number;
};

export type RefreshListConfig = {
  page: Page;
  dataSource: any[];
  queryParams: any;
  loadPage(params: any, loaded: (datas: PageData) => void): void;
}

export function defaultConfig(): RefreshListConfig {
  return {
    page: {
      current: 1,
      pageSize: 20,
    },
    dataSource: [],
    queryParams: {},
    loadPage(params, loaded) {
    }
  }
}